home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / SYS / s / diff.rexx < prev    next >
OS/2 REXX Batch file  |  1996-09-26  |  753b  |  42 lines

  1. /*
  2. ** $VER: diff.rexx 37.2 (13.8.93)
  3. **
  4. ** Diff source file and dest file of the same name.
  5. **
  6. ** Written by Douglas Keller
  7. */
  8.  
  9. options results
  10. address command
  11.  
  12. parse arg srcfile destdir .
  13.  
  14. if file == "" then do
  15.     say "Usage: diff <filename> <dest directory>"
  16.     exit 10
  17.     end
  18.  
  19. /* rush sends filenames quoted so strip spaces and quotes */
  20. srcfile= strip(srcfile,b,'"')
  21.  
  22. pos=lastpos("/",srcfile)
  23. if pos == 0 then do
  24.   pos=lastpos(":",srcfile)
  25. end
  26.  
  27. pos = pos + 1
  28. fileonly= substr(srcfile,pos)
  29.  
  30. say "===== Diffing " || fileonly || " ====="
  31.  
  32. if destdir == "" || right(destdir, 1) == ":" then
  33.   destfile= destdir || fileonly
  34. else
  35.   destfile= destdir || '/' || fileonly
  36.  
  37. cmdline = 'diff "' || srcfile || '" "' || destfile || '"'
  38.  
  39. address command cmdline
  40.  
  41. exit rc
  42.